Do not unset sensitivity mistakenly in gtk_widget_set_state_flags()
authorCarlos Garnacho <carlosg@gnome.org>
Sun, 23 Jan 2011 17:21:32 +0000 (18:21 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sun, 23 Jan 2011 18:34:44 +0000 (19:34 +0100)
together with commit 8903615a34, this finally fixes bug #640282.
Insensitivity is handled separatedly in _gtk_widget_update_state_flags(),
but the insensitive flag is mistakenly unset afterwards if clear is TRUE
in gtk_widget_set_state_flags().

gtk/gtkwidget.c

index c1950894a92a2252bd503a87a171f983d0886a80..7090dc68d521d668448ccb2c67f259d21565556a 100644 (file)
@@ -6969,7 +6969,8 @@ _gtk_widget_update_state_flags (GtkWidget     *widget,
     gtk_widget_set_sensitive (widget,
                               operation != STATE_CHANGE_UNSET);
 
-  flags &= ~(GTK_STATE_FLAG_INSENSITIVE);
+  if (operation != STATE_CHANGE_REPLACE)
+    flags &= ~(GTK_STATE_FLAG_INSENSITIVE);
 
   /* Focused state is meant to be set only on the widget
    * being changed itself, not on the children */